home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / graphics / universalgio / hhsconvertiffanim.rx < prev    next >
Text File  |  1999-04-19  |  2KB  |  58 lines

  1. /* ConvertIFFAnim.rx for Photogenics © by Helmut Hoffmann 1996 */
  2. /* Make HHsYUVSq animation from IFF animation formats */
  3. /* with Photogenics 2 or higher */
  4.  
  5. OPTIONS RESULTS
  6.  
  7. if ~SHOW('p','PHOTOGENICS.1') then do
  8.   say "This script needs a running Photogenics 2 or higher"
  9.   say "and HHsYUSSqSaver.gio to convert animations"
  10.   exit
  11. end
  12.  
  13. say "Please switch to Photogenics screen for file selection."
  14. address PHOTOGENICS.1
  15. PgsToFront
  16.  
  17. askfile '"Select source IFF animation"' ""
  18. if rc~=0 then exit
  19. sourceanim=result
  20. asksavefile '"Select destination HHsYUVSq animation name"' ""
  21. if rc~=0 then exit
  22. destanim=result
  23.  
  24. asknumber '"Number of frames requester"' '"How many frames should be loaded?"' 1 999
  25. framemax=result
  26.  
  27. say "Source animation:" sourceanim
  28. say "Load max. " framemax " Frames"
  29. say "Destination animation:" destanim
  30.  
  31. OpenProgress '"Animation conversion"' '"Conversion begins..."'
  32. frame=1
  33. DO FOREVER
  34.   say "Trying to load frame " frame
  35.   SetProgress '"Load frame 'frame'"' (frame*2-1)*50/framemax
  36.   if result=0 then leave
  37.   LoadHideGIO "ANIM" sourceanim frame
  38.   if rc~=0 then leave
  39.   buffer=result
  40.   say "Trying to save frame " frame
  41.   SetProgress '"Save frame 'frame'"' frame*100/framemax
  42.   if result=0 then do
  43.     CLOSE buffer
  44.     leave
  45.   end
  46.   SAVE buffer "HHsYUVSequence" "" destanim
  47.   if rc~=0 then do
  48.     CLOSE buffer
  49.     SHOWERROR '"Animation conversion failed! Check frame dimensions etc..."'
  50.     leave
  51.   end
  52.   CLOSE buffer
  53.   frame=frame+1
  54.   if frame>framemax then leave
  55. END
  56. CloseProgress
  57.  
  58.